package day22;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

/**
 * 题目：找出字符串中第一个只出现一次的字符
 * 题目链接：https://www.nowcoder.com/practice/e896d0f82f1246a3aa7b232ce38029d4?tpId=37&&tqId=21282&rp=1&ru=/activity/oj&qru=/ta/huawei/question-ranking
 */
public class Main1 {
    public static void findFristStr(String str) {
        char[] chars = str.toCharArray();
        int[] arr = new int[128];
        //统计每个字符出现次数
        for (int i = 0; i < chars.length; i++) {
            arr[chars[i]]++;
        }
        boolean ret = false;
        //查找
        for (int i = 0; i < chars.length; i++) {
            if(arr[chars[i]] == 1) {
                System.out.println(chars[i]);
                ret = true;
                break;
            }
        }
        if(!ret) {
            System.out.println(-1);
        }
    }

    public static void main(String[] args) throws IOException {
        BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
        String line;
        while ((line = reader.readLine()) != null ) {
            findFristStr(line);
        }
    }
}
